Don't abort resolution on transitive updates
authorAlex Crichton <alex@alexcrichton.com>
Tue, 6 Mar 2018 05:21:47 +0000 (21:21 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 15 Mar 2018 14:44:35 +0000 (07:44 -0700)
commit51d235606a53f9894c0a406c7beec08a7275b3ff
tree7fcfa321d10dbda51c6357383c29c3213436e5f5
parent9659f5603276ae883e92b202b6d2954b3354e8da
Don't abort resolution on transitive updates

This commit is directed at fixing #4127, allowing the resolver to automatically
perform transitive updates when required. A few use casese and tagged links are
hanging off #4127 itself, but the crux of the issue happens when you either add
a dependency or update a version requirement in `Cargo.toml` which conflicts
with something listed in your `Cargo.lock`. In this case Cargo would previously
provide an obscure "cannot resolve" error whereas this commit updates Cargo to
automatically perform a conservative re-resolution of the dependency graph.

It's hoped that this commit will help reduce the number of "unresolvable"
dependency graphs we've seen in the wild and otherwise make Cargo a little more
ergonomic to use as well. More details can be found in the source's comments!

Closes #4127
Closes #5182
15 files changed:
src/cargo/core/dependency.rs
src/cargo/core/package.rs
src/cargo/core/registry.rs
src/cargo/core/resolver/encode.rs
src/cargo/core/resolver/mod.rs
src/cargo/core/workspace.rs
src/cargo/ops/cargo_rustc/mod.rs
src/cargo/ops/resolve.rs
src/cargo/sources/path.rs
tests/testsuite/cargotest/support/mod.rs
tests/testsuite/main.rs
tests/testsuite/overrides.rs
tests/testsuite/registry.rs
tests/testsuite/resolve.rs
tests/testsuite/update.rs [new file with mode: 0644]